Skip to content

Conversation

@jordan-powers
Copy link
Contributor

Fixes #135031

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Jordan, I left a few questions.

}
}

@SuppressWarnings("unchecked")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add the supress warning to the places where it is needed? For example:

@SuppressWarnings("unchecked")
Map<String, Object> mapping = getMapping(client(), backingIndex0);
@SuppressWarnings("unchecked")
Map<String, Object> patternFieldMapping = (Map<String, Object>) ((Map<String, Object>) mapping.get("properties")).get(
                "message"
            );

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, yep I just added the whole-function SuppressWarnings just while I was developing the test and I meant to move it to the specific line, but it slipped my mind

Setting.Property.Dynamic,
Setting.Property.NodeScope
);
static final Setting<Boolean> LOGSDB_DEFAULT_SORT_ON_MESSAGE_TEMPLATE = Setting.boolSetting(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chatted with @romseygeek about this and we agree with introducing this setting that makes it easier to experiment with pattern_text field type (compared to manually updating index sorting). Given that this setting is disabled by default and only makes sense if pattern_text field type is configured for the message field.

Before merging this PR we should wait to see the result of #134221. So let's merge this PR and enabled it in the benchmark run that uses pattern_text next week?

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@martijnvg
Copy link
Member

One small post approval comment: Maybe also update the docs for pattern_text to explain this new index setting?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

🔍 Preview links for changed docs

@github-actions
Copy link
Contributor

ℹ️ Important: Docs version tagging

👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version.

We use applies_to tags to mark version-specific features and changes.

Expand for a quick overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

@jordan-powers jordan-powers enabled auto-merge (squash) October 29, 2025 21:15
@jordan-powers jordan-powers merged commit 480d198 into elastic:main Oct 29, 2025
34 checks passed
shmuelhanoch pushed a commit to shmuelhanoch/elasticsearch that referenced this pull request Oct 29, 2025
…stic#136571)

This PR adds the index setting 
`index.logsdb.default_sort_on_message_template`. When set, LogsDB indices
will add `message.template_id` to the default sort fields (assuming the
`message` field is present and of type `pattern_text`).
jordan-powers added a commit to elastic/rally-tracks that referenced this pull request Oct 30, 2025
Use the mapping parameter added in elastic/elasticsearch#136571 to sort on
message.template_id instead of manually specifying with index.sort.fields.

Relates to #825.
chrisparrinello pushed a commit to chrisparrinello/elasticsearch that referenced this pull request Nov 3, 2025
…stic#136571)

This PR adds the index setting 
`index.logsdb.default_sort_on_message_template`. When set, LogsDB indices
will add `message.template_id` to the default sort fields (assuming the
`message` field is present and of type `pattern_text`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sort by pattern_text field if exists

3 participants